<template>
	<view class="container">
		<view class="list" @click="CaseInfo(item.ID)" v-for="item in List">
			<view class="img"><image :src="item.Img" mode="aspectFill"/></view>
			<view class="name">{{item.Name}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				Tip:'正在加载...',
				Page:1,
				List:[],
				NoData:false,
				LoadMore:true,
				Keyword:''
			};
		},
		onLoad() {
			this.Find_Pager();
		},
		methods:{
			CaseInfo(ID){
				uni.navigateTo({
					url:'/pages/case/caseinfo?ID='+ID
				})
			},
			Find_Pager(){
				var data={};
				data.Act="Find_Case";
				data.Page=this.Page;
				data.Keyword=this.Keyword;
				data.Limit=20;
				this.Util.Loading("加载中...");
				this.Util.Post(data, json=>{
					this.Util.HideLoading();
					uni.stopPullDownRefresh();
					this.List= this.List.concat(json.Data.List);
					uni.stopPullDownRefresh();
					if(json.Data.Count==0){
						this.NoData=true;
						this.Tip="还没有任何案例信息";
					}
					else if(this.List.length>=json.Data.Count){
						this.LoadMore=false;
						this.Tip="我是有底线的";
					}
				});
			},
			Re_Load(){
				this.List=[];
				this.Page=1;
				this.NoData=false;
				this.LoadMore=true;
				this.Tip='正在加载...';
				this.Find_Pager();
			}
		}
	}
</script>

<style lang="scss">
	.container{display: flex; flex-direction: row;
		.list{width:710rpx; min-height:400rpx; margin-bottom:15rpx; border-radius: 20rpx; margin-top:20rpx; background-color: #ffffff; margin-left:20rpx; overflow: hidden;
			.img{width:100%; height:320rpx; overflow: hidden; image{width:710rpx; height:320rpx; object-fit: cover;}}
			.name{width:100%; height:auto; line-height: 46rpx; padding-top:10rpx; padding-bottom: 10rpx; padding-left: 20rpx; padding-right: 20rpx;}
		}
		.list:active{background-color: #dbdbdb;}
	}
</style>
